package cn.appsm.persistance.pageSupport;

@Deprecated
public class OraclePageDialect extends PageDialect {

	@Override
	public String getPageSql(String sql, int offset, String offsetPlaceholder,
			int limit, String limitPlaceholder) {
		sql = sql.trim();
		StringBuilder pagingSelect = new StringBuilder(sql.length() + 100);
		pagingSelect.append("select * from ( select tmp_1.*, rownum rn1  from ( ");
		pagingSelect.append(sql);
		pagingSelect.append(" ) tmp_1 where rownum <= ").append(limitPlaceholder);
		pagingSelect.append(" ) tmp_2 where rn1 >=  ").append(offsetPlaceholder );
		return pagingSelect.toString();
	}

}
